Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-12490] Extract OrganizationService.EnableAsync into commands #5321

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

r-tome
Copy link
Contributor

@r-tome r-tome commented Jan 24, 2025

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-12490

📔 Objective

Extract OrganizationService.EnableAsync to OrganizationEnableCommand.

Add unit tests for OrganizationEnableCommand.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@r-tome r-tome force-pushed the ac/pm-12490/create-organization-enable-command branch from d3b751a to 4c3c230 Compare January 24, 2025 12:58
Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 74.19355% with 8 lines in your changes missing coverage. Please review.

Project coverage is 44.33%. Comparing base (e4d862f) to head (feb16eb).

Files with missing lines Patch % Lines
...ervices/Implementations/PaymentSucceededHandler.cs 0.00% 4 Missing ⚠️
...ices/Implementations/SubscriptionUpdatedHandler.cs 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5321      +/-   ##
==========================================
+ Coverage   44.30%   44.33%   +0.02%     
==========================================
  Files        1497     1498       +1     
  Lines       69207    69214       +7     
  Branches     6241     6241              
==========================================
+ Hits        30661    30684      +23     
+ Misses      37223    37207      -16     
  Partials     1323     1323              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@r-tome r-tome marked this pull request as ready for review January 24, 2025 13:49
@r-tome r-tome requested review from a team as code owners January 24, 2025 13:49
@r-tome r-tome requested a review from JimmyVo16 January 24, 2025 13:49
Copy link
Contributor

github-actions bot commented Jan 24, 2025

Logo
Checkmarx One – Scan Summary & Details7b02c69d-ab75-4fa9-88ec-9b2269bc7abd

New Issues (14)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
MEDIUM Missing_HSTS_Header /src/Billing/Startup.cs: 37
detailsThe web-application does not define an HSTS header, leaving it vulnerable to attack.
Attack Vector
MEDIUM Privacy_Violation /src/Api/Vault/Models/Request/CipherRequestModel.cs: 173
detailsMethod ToCipherLoginData at line 173 of /src/Api/Vault/Models/Request/CipherRequestModel.cs sends user information outside the application. This ma...
Attack Vector
MEDIUM Privacy_Violation /src/Core/Auth/Services/Implementations/AuthRequestService.cs: 226
detailsMethod UpdateAuthRequestAsync at line 226 of /src/Core/Auth/Services/Implementations/AuthRequestService.cs sends user information outside the appli...
Attack Vector
MEDIUM Privacy_Violation /src/Api/Vault/Models/Request/CipherRequestModel.cs: 202
detailsMethod ToCipherIdentityData at line 202 of /src/Api/Vault/Models/Request/CipherRequestModel.cs sends user information outside the application. This...
Attack Vector
LOW Log_Forging /src/Api/AdminConsole/Controllers/OrganizationsController.cs: 531
detailsMethod PutCollectionManagement at line 531 of /src/Api/AdminConsole/Controllers/OrganizationsController.cs gets user input from element model. This...
Attack Vector
LOW Log_Forging /src/Api/AdminConsole/Controllers/OrganizationsController.cs: 204
detailsMethod Put at line 204 of /src/Api/AdminConsole/Controllers/OrganizationsController.cs gets user input from element model. This element’s value flo...
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 163
detailsMethod UpdatePaymentMethodAsync at line 163 of /src/Api/Billing/Controllers/OrganizationBillingController.cs gets user input from element requestBo...
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 163
detailsMethod UpdatePaymentMethodAsync at line 163 of /src/Api/Billing/Controllers/OrganizationBillingController.cs gets user input from element requestBo...
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 163
detailsMethod UpdatePaymentMethodAsync at line 163 of /src/Api/Billing/Controllers/OrganizationBillingController.cs gets user input from element requestBo...
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/ProviderBillingController.cs: 104
detailsMethod UpdateTaxInformationAsync at line 104 of /src/Api/Billing/Controllers/ProviderBillingController.cs gets user input from element requestBody....
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/ProviderBillingController.cs: 104
detailsMethod UpdateTaxInformationAsync at line 104 of /src/Api/Billing/Controllers/ProviderBillingController.cs gets user input from element requestBody....
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/ProviderBillingController.cs: 104
detailsMethod UpdateTaxInformationAsync at line 104 of /src/Api/Billing/Controllers/ProviderBillingController.cs gets user input from element requestBody....
Attack Vector
LOW Log_Forging /src/Api/Billing/Controllers/OrganizationBillingController.cs: 163
detailsMethod UpdatePaymentMethodAsync at line 163 of /src/Api/Billing/Controllers/OrganizationBillingController.cs gets user input from element requestBo...
Attack Vector
LOW Missing_CSP_Header /src/Core/MailTemplates/Handlebars/Layouts/Full.html.hbs: 164
detailsA Content Security Policy is not explicitly defined within the web-application.
Attack Vector
Fixed Issues (13)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 110
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 124
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 997
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 737
MEDIUM CSRF /src/Billing/Controllers/BitPayController.cs: 52
MEDIUM Privacy_Violation /src/Core/Auth/Services/Implementations/AuthRequestService.cs: 221
LOW Log_Forging /src/Billing/Controllers/StripeController.cs: 164
LOW Log_Forging /src/Billing/Controllers/RecoveryController.cs: 38
LOW Log_Forging /src/Billing/Controllers/StripeController.cs: 164
LOW Log_Forging /src/Billing/Controllers/RecoveryController.cs: 38
LOW Log_Forging /src/Billing/Controllers/StripeController.cs: 164
LOW Log_Forging /src/Billing/Controllers/RecoveryController.cs: 38
LOW Log_Forging /src/Billing/Controllers/RecoveryController.cs: 38

Copy link
Contributor

@amorask-bitwarden amorask-bitwarden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 from Billing

jonashendrickx
jonashendrickx previously approved these changes Jan 27, 2025
# Conflicts:
#	src/Core/AdminConsole/Services/IOrganizationService.cs
#	src/Core/AdminConsole/Services/Implementations/OrganizationService.cs
#	src/Core/OrganizationFeatures/OrganizationServiceCollectionExtensions.cs
@r-tome
Copy link
Contributor Author

r-tome commented Jan 28, 2025

I had to fix a few merge conflicts

Copy link
Contributor

@JimmyVo16 JimmyVo16 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good, just one minor request with the test code.

@r-tome r-tome requested a review from JimmyVo16 January 29, 2025 10:44
JimmyVo16
JimmyVo16 previously approved these changes Jan 29, 2025
Copy link
Contributor

@cturnbull-bitwarden cturnbull-bitwarden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

jonashendrickx
jonashendrickx previously approved these changes Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants